#!/bin/bash
if [ $(ps -C nginx --no-header|wc -l)  -eq 0 ];then                            
      #/usr/local/nginx/sbin/nginx                #重启nginx
      systemctl start nginx   #重启nginx
      if [ `ps -C nginx --no-header |wc -l` -eq 0 ];then    #nginx重启失败，则停掉keepalived服务，进行VIP转移
              killall keepalived                    
      fi
fi

